#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>


int main()
{
    char arr[256] = { 0 };
    int i = 0, a = 0, b = 0;
    while (scanf("%c", &arr[i]) != EOF)
    {
        if (arr[i] == '@')
        {
            arr[i] = '\0';
            break;
        }
        if (arr[i] == '(')
            a++;
        else if (arr[i] == ')')
            b++;
        i++;
    }
    if (a != b)
        printf("NO\n");
    else
    {
        printf("YES\n");
    }

    return 0;
}